# 基础镜像
FROM python:3.9-alpine

# 创建app目录并切换进入目录下
WORKDIR /app

COPY . .

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
    apk update && \
    apk upgrade && \
    apk add --no-cache tzdata mariadb-dev gcc libc-dev && \
    python -m pip install -i https://pypi.douban.com/simple --upgrade pip && \
    pip install --no-cache-dir -i https://pypi.douban.com/simple -r requirements.txt && \
    chmod 777 ./entrypoint.sh

# 创建日志挂载点
VOLUME /app/logs/

EXPOSE 8000

# 容器启动时执行shell脚本
ENTRYPOINT ["./entrypoint.sh"]

